home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d968.lha
/
JustLook
/
Source
/
Handlers.asm
next >
Wrap
Assembly Source File
|
1993-12-04
|
2KB
|
94 lines
; Handlers.asm, For use in JustLook.
; © Kamran Karimi.
;
; Assembled with SAS/C 6.00 assembler.
; asm -iinclude: Handlers.asm
include "devices/inputevent.i"
ExecBase equ 4
Signal equ -324
XREF _Me
XREF _NoKey_Port
XREF _NoMouse_Port
XDEF _DisableIE
XREF _LeftMask
XREF _MidMask
XREF _RightMask
XDEF _WaitIE
SECTION TheHandlers,CODE
_DisableIE:
move.l a0,-(a7)
CheckLoopDIE:
move.l _NoKey_Port,d0
beq KeyNotDisabled
cmpi.b #IECLASS_RAWKEY,ie_Class(a0)
beq Null_It
KeyNotDisabled:
move.l _NoMouse_Port,d0
beq MouseNotDisabled
move.b ie_Class(a0),d0
cmpi.b #IECLASS_POINTERPOS,d0
beq Null_It
cmpi.b #IECLASS_NEWPOINTERPOS,d0
beq Null_It
cmpi.b #IECLASS_RAWMOUSE,d0
bne NotAMouseEvent
Null_It:
cmpi.b #$ff,ie_SubClass(a0)
beq CheckNextDIE
move.b #IECLASS_NULL,ie_Class(a0)
NotAMouseEvent:
MouseNotDisabled:
CheckNextDIE:
move.l (a0),d0
move.l d0,a0
bne CheckLoopDIE
move.l (a7)+,d0
rts
_WaitIE:
move.l a0,-(a7)
CheckLoopWIE:
cmpi.b #IECLASS_RAWMOUSE,ie_Class(a0)
bne CheckNextWIE
moveq #0,d0
TestLeftButton:
cmpi.w #IECODE_LBUTTON,ie_Code(a0)
bne TestMidButton
or.l _LeftMask,d0
TestMidButton:
cmpi.w #IECODE_MBUTTON,ie_Code(a0)
bne TestRightButton
or.l _MidMask,d0
TestRightButton:
cmpi.w #IECODE_RBUTTON,ie_Code(a0)
bne SignalIt
or.l _RightMask,d0
SignalIt:
tst.l d0
beq CheckNextWIE
move.l a6,-(a7)
movea.l ExecBase,a6
movea.l _Me,a1
jsr Signal(a6)
move.l (a7)+,a6
bra ExitWIE
CheckNextWIE:
movea.l (a7),a0
move.l (a0),d0
movea.l d0,a0
bne CheckLoopWIE
ExitWIE:
move.l (a7)+,d0
rts
end